package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: qingtao
 * @Date 2022/3/23 18:02
 */
public interface OrderMapper{
    /**
     * 添加一条数据
     * @param orders
     */
    @Insert("insert into orders values (#{id},#{number},#{status},#{userId},#{addressBookId}," +
            "#{orderTime},#{checkoutTime},#{payMethod},#{amount},#{remark},#{phone},#{address},#{userName},#{consignee})")
    void save(Orders orders);

    /**
     * 查询
     * @return
     */
    List<Orders> findByPage(@Param("id") Long id,@Param("userId")Long userId);
}
